package com.auxgroup.hr.front.service.personnal.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import com.auxgroup.hr.front.dao.domain.PsCItTechTbl;
import com.auxgroup.hr.front.dao.domain.PsCPersonalInfoClass;
import com.auxgroup.hr.front.dao.repository.PsCItTechTblRepository;
import com.auxgroup.hr.front.service.personnal.ItTechTblService;

/** 
 * @author wangchangyun
 * @version 创建时间：180523 
 * 计算机能力service
 */
@Service("itTechTblService")
public class ItTechTblServiceImpl implements ItTechTblService {
	private static final Logger logger = LoggerFactory.getLogger(ItTechTblServiceImpl.class);
	
	@Autowired
	private PsCItTechTblRepository PsCItTechTblRepository;


	@Override
	public PsCItTechTbl getItTechTbl(PsCPersonalInfoClass personalInfo) {
		return PsCItTechTblRepository.findOne(personalInfo);
	}


	@Override
	public PsCItTechTbl save(PsCItTechTbl ItTechTbl) {
		return PsCItTechTblRepository.save(ItTechTbl);
	}


	@Override
	public Boolean delete(PsCPersonalInfoClass personalInfo) {
		try {
			PsCItTechTblRepository.delete(personalInfo);
		} catch (Exception e) {
			logger.error("delete ItTechTbl error: personalInfo={}",personalInfo,e);
			return false;
		}
		return true;
	}
	
	
	@Override
	public List<PsCItTechTbl> getAll(String emplid) {
		PsCItTechTbl ItTechTbl = new PsCItTechTbl();
		ItTechTbl.setEmplid(emplid);
		return PsCItTechTblRepository.findAll(Example.of(ItTechTbl));
	}


	
	
	
}
